#ifndef __IIC_H
#define __IIC_H

#include "stm32f4xx_conf.h"
#include "bsp_sys.h"

/*  */
#define SDA_IN()  {GPIOB->MODER&=~(3<<(11*2));GPIOB->MODER|=0<<11*2;}	
#define SDA_OUT() {GPIOB->MODER&=~(3<<(11*2));GPIOB->MODER|=1<<11*2;} 

/*  */
#define IIC_SCL    PBout(10) 
#define IIC_SDA    PBout(11)  
#define READ_SDA   PBin(11)  

/* IIC function declearation */
void IIC_Init(void);                

u8 MPU_Read_Byte(u8 addr,u8 reg);
u8 MPU_Read_Len(u8 addr,u8 reg,u8 len,u8 *buf);
u8 MPU_Write_Byte(u8 addr,u8 reg,u8 data);
u8 MPU_Write_Len(u8 addr,u8 reg,u8 len,u8 *buf);
#endif
